<template>
	<xbd-select title="请选择楼宇" :carId.sync="title" :visible.sync="visible" :infoList="typeArr" >
		<template>
			<view class="row-item"  @click="visible = true">
				<view class="left">
					<slot name="left">
						<image src="@/static/images/deliveryorder/louyu.svg" mode=""></image>
						<text>{{ title }}</text>
					</slot>
				</view>
				<view class="right">
					<slot name="right">
						<uni-icons type="arrowright" size="18" color="#999"></uni-icons>
					</slot>
				</view>
			</view>
		</template>
	</xbd-select>
	
</template>

<script>
	export default {
		name: 'RowItem',
		data() {
			return {
				title: '',
				visible: false,
			};
		},
		watch: {
			title(val) {
				let id = '';
				this.typeArr.forEach(item => {
					if (item.label === val) {
						id = item.value;
					}
				})
				this.$emit('changeId', id);
			}
		},
		props: {
			typeArr: {
				type: Array
			}
		},
		methods: {
		},
		computed:{
			title(){}
		}
	}
</script>

<style scoped lang="scss">
	.row-item {
		display: flex;
		justify-content: space-between;
		align-items: center;
		
		padding: 20px 30rpx;
		margin-bottom: 10px;
		
		background-color: #FFFFFF;
		.left {
			display: flex;
			align-items: center;
			font-size: 28rpx;
			
			color: #222222;
			image {
				width: 50rpx;
				height: 50rpx;
				margin-right: 10rpx;
			}
		}
	}
</style>
